print("请输入一个字符串:")

sentence = input()

count = 0

for letter in sentence:
    if letter == ' ':
        count+=1

print("字符串的空格个数为:",count)
